<style>
    .upload-image {
        background: url('__CDN__/assets/addons/example/img/plus.png') no-repeat center center;
        background-size: 30px 30px;
        height: 30px;
        width: 30px;
        border: 1px solid #ccc;
    }
</style>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control" name="row[name]" type="text">
        </div>
    </div>

<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-cate_id" data-rule="required" data-source="cate/index" class="form-control selectpage" name="row[cate_id]" type="text" value="">-->
<!--        </div>-->
<!--    </div>-->

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline" data-toggle="cxselect" data-selects="province,city,area">
                <select class="province form-control" name="cate_id" data-url="goods/goods/category"></select>
                <select class="city form-control" name="cate_ids" data-url="goods/goods/category"></select>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" class="form-control" size="50" name="row[image]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>

<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Num')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-num" class="form-control" name="row[num]" type="number">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Pool')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-pool" class="form-control" name="row[pool]" type="number">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Integer')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-integer" class="form-control" name="row[integer]" type="number">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-money" class="form-control" name="row[money]" type="number">-->
<!--        </div>-->
<!--    </div>-->

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('State')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[state]', ['1'=>__('Yes'), '2'=>__('No')])}
        </div>
    </div>


<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-money" class="form-control" step="0.01" name="row[money]" type="number">-->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-desc" class="editor" rows="5" name="row[desc]" cols="50"></textarea>
        </div>
    </div>


    <div class="row">
        <div class="col-md-6">
            <div class="box box-info">
                <div class="panel-body">
                    <div class="form-group row">
                            <div class="col-xs-12">
                                <table class="table fieldlist" data-template="basictpl" data-name="row[basic]" id="first-table">
                                    <tr>
                                        <td>{:__('Specs')}</td>
                                        <td>{:__('Money')}</td>
                                        <td>{:__('vipMoney')}</td>
                                        <td>{:__('Stock')}</td>
                                        <td>{:__('Integral')}</td>
                                        <td width="100"></td>
                                    </tr>
                                    <tr>
                                        <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                                    </tr>
                                </table>

                                <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
                                <textarea name="row[basic]" class="form-control" cols="30" rows="5" style="display:none"> </textarea>

                                <script id="basictpl" type="text/html">
                                    <tr class="form-inline">
                                        <td><input type="text" name="<%=name%>[<%=index%>][title]" class="form-control" size="5" value="<%=row.title%>" placeholder="例如：葵花籽油3.9L"/></td>
                                        <td><input type="text" name="<%=name%>[<%=index%>][intro]" class="form-control" size="5" value="<%=row.intro%>" placeholder="例如：65"/></td>
                                        <td><input type="text" name="<%=name%>[<%=index%>][vip_money]" class="form-control" size="5" value="<%=row.vip_money%>" placeholder="例如：40"/></td>
                                        <td><input type="text" name="<%=name%>[<%=index%>][stock]" class="form-control" size="5" value="<%=row.stock%>" placeholder="库存：100"/></td>
                                        <td><input type="text" name="<%=name%>[<%=index%>][integral]" class="form-control" size="5" value="<%=row.integral%>" placeholder="积分：10"/></td>
                                        <td>
                                            <!--下面的两个按钮务必保留-->
                                            <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                                            <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                                        </td>
                                    </tr>
                                </script>
                            </div>
                        </div>
                </div>
            </div>
        </div>
    </div>





<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">-->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
